package com.sale.system.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.sale.system.service.ISysEncodeApi;
import org.springframework.stereotype.Service;

/**
 * 编码实现类
 *
 * @author zhangyingdong
 * @version 1.0.0
 * @package com.sale.system.service.impl
 * @className SysEncodeApiImpl
 * @date 2022-12-11  11:17
 */
@Service
public class SysEncodeApiImpl implements ISysEncodeApi {
    @Override
    public String buildEncode(String no) {

        String prefix = null;
        if ("grt_dbw_no".equals(no)) {
            prefix = "DBW_";
        } else if("grt_bz_no".equals(no)) {
            prefix = "BZ_";
        }
        return prefix + RandomUtil.randomNumbers(8);
    }
}
